package com.kellyfeng.spittr;

import org.hibernate.cfg.Environment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

@Configuration
@PropertySource("classpath:/app.properties")
public class BeanConfig {
	//@Autowired
	//Environment env;  //用env.getProperty("");调用属性

	//@Bean
	//@Scope(ScopeProxMode.INTERFACES)
	//@Conditional()  //implements Condition  
	
	/**
	 * @return 为了使用属性占位符${...}调用属性,调用方法@Value 
	 */
	@Bean
	public static PropertySourcesPlaceholderConfigurer placeholderConfigurer(){
		return new PropertySourcesPlaceholderConfigurer();
	}
	
	/**
	 * @return 声明切面类
	 */
	@Bean
	public SpittrAop spittrAop(){
		return new SpittrAop();
	}
	
}
